#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>

int main()
{
	int arr[6][6] = {0};
	arr[0][0] = 1;
	arr[1][0] = 1;
	arr[1][1] = 1;
	for (int i = 2; i < 5; i++)
	{
		for (int j = 0; j < i + 1; j++)
		{
			if (j == 0)
			{
				arr[i][j] = 1;
			}
			else if (i == j)
			{
				arr[i][j] = 1;
			}
			else
			{
				arr[i][j] = arr[i - 1][j - 1] + arr[i - 1][j];
			}
		}
	}
	for (int i = 0; i < 5; i++)
	{
		for (int j = 0; j <= i ; j++)
		{
			printf("%d", arr[i][j]);
		}
		printf("\n");
	}
	return 0;
}